import request from '@/utils/request'

// 查询复购订单列表
export function listRepeatPurchaseOrder(query) {
    return request({
        url: '/system/order/list',
        method: 'get',
        params: {
            orderType: 2,
            ...query
        }
    })
}

// 查询复购订单详情
export function getRepeatPurchaseOrder(orderId) {
    return request({
        url: '/system/order/' + orderId,
        method: 'get'
    })
}

// 新增复购订单
export function addRepeatPurchaseOrder(data) {
    return request({
        url: '/system/order/repurchase/add',
        method: 'post',
        data: data
    })
}

// 新增多包裹复购订单
export function addRepeatPurchaseOrders(data) {
    return request({
        url: '/system/order/repurchase/adds',
        method: 'post',
        data: data
    })
}

// 修改复购订单
export function updateRepeatPurchaseOrder(data) {
    return request({
        url: '/system/order',
        method: 'put',
        data: data
    })
}

// 删除复购订单
export function delRepeatPurchaseOrder(orderId) {
    return request({
        url: '/system/order/' + orderId,
        method: 'delete'
    })
}


// 新增复购补货订单     
export function addRepeatPurchaseReplenishmentOrder(data) {
    return request({
        url: '/system/order/replenishment/add',
        method: 'post',
        data: data
    })
}

// 追加复购订单
export function addRepeatPurchaseAppendOrder(data) {
    return request({
        url: '/system/order/appendRepurchase/add',
        method: 'post',
        data: data
    })
}
